package com.zf.zffencheng.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zf.zffencheng.dao.DeviceTemplateDao;
import com.zf.zffencheng.model.pojo.DeviceTemplate;
import com.zf.zffencheng.service.DeviceTemplateService;
import org.springframework.stereotype.Service;

/**
 * ClassName: DeviceTemplateServiceImpl <br/>
 * Description:  <br/>
 * date: 2021/5/31 17:13<br/>
 *
 * @author william <br/>
 */
@Service
public class DeviceTemplateServiceImpl extends ServiceImpl<DeviceTemplateDao, DeviceTemplate> implements DeviceTemplateService {
    /**
     * 获取规格
     *
     * @param version
     * @param type
     * @param deviceType
     * @return
     */
    @Override
    public DeviceTemplate getByVersionAndTypeAndTypeId(Integer version, Integer type, Integer deviceType) {
        QueryWrapper<DeviceTemplate> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("Version", version);
        queryWrapper.eq("Type", type);
        queryWrapper.eq("TypeID", deviceType);
        return getOne(queryWrapper, false);
    }
}
